<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        // let a = Symbol();
        // console.log(a);
        // let b = Symbol();
        // let c = Symbol();
        // console.log(b,c);
        // console.log(b === c);
        // console.log(b == c);

        // let a = Symbol("name");
        // let b = Symbol("name");
        // console.log(a,b);
        // console.log(a === b);
        // console.log(a == b);

        // 模拟私有属性
        // let a = Symbol("name");
        // let b = Symbol("age");
        // let obj = {
        //     [a]:"小明",
        //     [b]:"18"
        // }
        // console.log(obj);
        // console.log(obj[a]);
        // console.log(obj[b]);
        // console.log(obj.name,obj.age);
        // obj.name = "张三";
        // console.log(obj);
        // console.log([a])

        let a = Symbol("name");
        let b = Symbol("age");
        let obj = {
            [a]:"哈哈哈",
            [b]:"18"
        }
        console.log(obj);
        console.log(obj[a]);
        console.log(obj[b]);
    </script>
</body>
</html>